<link href="/res/js/wysiwyg/jquery.wysiwyg.css" media="screen" rel="Stylesheet" type="text/css" />
<script type="text/javascript" src="/res/js/wysiwyg/jquery.wysiwyg.js"></script>
{literal}<script>
$(function()
{
    $('#wysiwyg').wysiwyg();
});
</script>{/literal}

<div class="add_category"><a href="/admin/category/">Категории</a> &rarr; <a href="/admin/category/view/{$cat.id}/">{$cat.name}</a> &rarr; Добавить фото</div>
<form action="/admin/photo/go/" method="post" enctype="multipart/form-data">
<input type="hidden" name="type" value="add" />
	<div id="content">
			<div id="inner">
			<table cellspacing="0" cellpadding="4">
				<tbody class="edit">
                    <tr>
						<th width="200px">Категория</th>
						<td>
                        <select name="id">
                            {foreach from=$category item=doc}
                                <option value="{$doc.id}" {if $cat.id == $doc.id}selected{/if}>{$doc.name}</option>
                                {foreach from=$doc.parent item=parent}
                                    <option value="{$parent.id}" {if $cat.id == $parent.id}selected{/if}>{$parent.name}</option>
                                {/foreach}  
                            {/foreach}
						</select>

                        </td>
					</tr>
					<tr>
						<th width="200px">Название фото</th>
						<td><input type="text" name="name" /></td>
					</tr>
					<tr>
						<th width="200px">Описание</th>
						<td><textarea name="description" id="wysiwyg"></textarea></td>
					</tr>
					<tr>
						<th width="200px">Картинка</th>
						<td><input type="file" name="userfile" /></td>
					</tr>
				</tbody>
			</table>
			</div>

	</div>
	<br />
	<input type="submit" value="Сохранить" />
</form>
